<template>
  <div class="checked">
    <div @click="checkedClick">
      <img
        src="~assets/img/cart/select2.png"
        alt=""
        v-show="checkedInfo.checked"
      />
      <img
        src="~assets/img/cart/select1.png"
        alt=""
        v-show="!checkedInfo.checked"
      />
    </div>
  </div>
</template>

<script>
export default {
  name: "CheckButton",
  props: {
    checkedInfo: {
      type: Object,
      default() {
        return [];
      },
    },
  },
  methods: {
    checkedClick() {
      this.$store.commit("changeChecked", this.checkedInfo.iid);
    },
  },
};
</script>

<style scoped>
.checked {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 1px;
}
.check img {
  width: 100%;
}
</style>
